package com.aiti.lulian.service.impl;

import com.aiti.base.core.utils.message.Message;
import com.aiti.lulian.mapper.ClusterMapper;
import com.aiti.lulian.service.IClusterService;
import com.aiti.lulian.vo.CardClusterInfoVo;
import com.aiti.lulian.vo.CardClusterListVo;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ClusterServiceImpl implements IClusterService {

    private final ClusterMapper clusterMapper;

    public ClusterServiceImpl(ClusterMapper clusterMapper) {
        this.clusterMapper = clusterMapper;
    }

    @Override
    public Message selectCurrentClusterList(Page page,String userId) {
        List<CardClusterListVo> cardClusterListVos = clusterMapper.selectCurrentClusterList(page, userId);
        return Message.success(cardClusterListVos);
    }

    @Override
    public CardClusterInfoVo selectClusterInfoById(String clusterId) {
        return clusterMapper.selectClusterInfoById(clusterId);
    }
}
